<?php
namespace event;

use app\admin\model\Log as LogModel;

class LoginEvent
{
    
	function login($user){
		$data['application_name'] = $user['application_name'];
		$data['username'] = $user['username'];
		$data['url'] = 'http:'.request()->fullUrl();
		$data['ip'] = request()->getRealIp($safe_mode=true);
		$data['useragent'] = request()->header()['user-agent'];;
		$data['create_time'] = time();
		$data['type'] = 1;
		
		LogModel::insert($data);
	}
	
}